-- guildChallengeVo
-- Author: mm
-- Date: 2018-03-19 15:59:54
-- 公会挑战数据结构

local fileName = string.getModeName(...)
local ClassRef = class(fileName)

-- message GuildChallengeInfo {
-- 	int32 id = 1;                       // 挑战任务id
-- 	int32 preChallenge = 2;             // 前置挑战任务id
-- 	int32 weekDay = 3;                  // 周几开启
-- 	int32 condition1Type = 4;           // 完成条件-类型
-- 	int32 condition1Par2 = 5;           // 当前完成进度
-- 	int32 state = 6;                    // 完成状态
-- 	bool getReward = 7;                 // 是否已领奖
-- 	repeated int32 staticCondition1Par1 = 8;    // 完成条件-参数1
-- 	int32 staticCondition1Par2 = 9;       // 目标进度
-- }

function ClassRef:ctor(data)
	self._id = 0
	self._preChallenge = 0
	self._weekDay = 0
	self._condition1Type = 0
	self._condition1Par2 = 0
	self._state = 0
	self._getReward = false
	self.staticCondition1Par1List = {}
	self._staticCondition1Par2 = 0

	if data then
		self:read(data)
	end
end

function ClassRef:read(data)
	self._id = data.id
	self._preChallenge = data.preChallenge
	self._weekDay = data.weekDay
	self._condition1Type = data.condition1Type
	self._condition1Par2 = data.condition1Par2
	self._state = data.state
	self._getReward = data.getReward
	self._staticCondition1Par2 = data.staticCondition1Par2
	for k,v in pairs( data.staticCondition1Par1 ) do
		table.insert( self.staticCondition1Par1List, v )
	end
end

-- 是否领取
function ClassRef:isGot()
	return self._getReward
end


return ClassRef
